package com.derbysoft.lowcostadapter.web.action.admin.cachemanager;

import com.derbysoft.lowcostadapter.schedule.sync.SyncFtpFilesService;
import com.derbysoft.lowcostadapter.web.action.BaseAdapterAction;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.util.List;

public class CacheManagerAction extends BaseAdapterAction {

    @Autowired
    @Qualifier("syncFtpFilesService")
    private SyncFtpFilesService syncFtpFilesService;

    private List<String> syncFtpFiles;

    @Action("list")
    public String list() {
        syncFtpFiles = syncFtpFilesService.getLocalFiles();
        return SUCCESS;
    }

    public List<String> getSyncFtpFiles() {
        return syncFtpFiles;
    }
}
